
#ifndef _TTG_PIPELINE_PARAMETRIZEDINPUT_
#define _TTG_PIPELINE_PARAMETRIZEDINPUT_
#include "Common/Definitions.h"

#include "NavigatorNode.h"

namespace ttg_internal
{
	namespace pipeline
	{
		//Definition of used class.
		template <class T>
		class ParametrizedOutput;

		//Represents input - essence, which can produce parametrized task data.
		template <class T>
		class ParametrizedInput
		{
			private:
				NavigatorNode *navigator;
				std::vector<ParametrizedOutput<T> *> outputs;
			protected:
				//Assigns navigator.
				inline void setNavigatorForInput(NavigatorNode *navigator)
				{ this->navigator = navigator; }
			public:
				inline ParametrizedInput()
				{ this->navigator = NULL; }
				//Returns assigned navigator.
				inline NavigatorNode *getNavigatorForInput()
				{ return navigator; }
				//Adds output, which can receive task data.
				inline void attachOutput(ParametrizedOutput<T> *output)
				{
					getParametrizedOutputs().push_back(output);
					getNavigatorForInput()->getOutputs().push_back(output->getNavigatorForOutput());
					getNavigatorForInput()->getInfo().getNext().push_back(
						&output->getNavigatorForOutput()->getInfo());
				}
				//Returns parametrized outputs, that was connected to this node/input.
				inline std::vector<ParametrizedOutput<T> *> &getParametrizedOutputs()
				{ return outputs; }
				virtual ~ParametrizedInput()
						{ /*nothing*/ }
		};
	}
}

#endif
